<?php

namespace app\services\exam;

use app\dao\exam\ExamPaperDao;
use app\exceptions\AuthException;
use app\services\BaseService;

class ExamPaperService extends BaseService
{
    public function __construct(ExamPaperDao $dao)
    {
        $this->dao = $dao;
    }

    public function index(array $where)
    {
        return $this -> dao -> index($where);
    }

    public function creatOrUpdate(array $where)
    {

        if ($where['id']) return $this -> dao -> updateDao($where);
        return  $this ->dao -> create($where);
    }

    public function delete(array $where)
    {
        return $this ->dao ->deleteDao($where);
    }

    public function searchPaperTopic(array $where)
    {
        return $this -> dao ->searchPaperTopic($where);
    }

    //----------------------------------------------api-------------------------------------------------------------

    /*
     * 测评题目
     */

    public function  getSubjiet(array $where){
       return $this->dao->getSubject($where);
    }
}